package com.dkcrow.hadoop.conf;

import org.apache.hadoop.conf.Configuration;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13. 3. 29
 * Time: 오후 12:20
 * To change this template use File | Settings | File Templates.
 */
public class MyConfiguration {

    static final String FS_DEFAULT_NAME = "hdfs://192.168.0.120:9000";
    static final String MAPRED_JOB_TRACKER = "hdfs://192.168.0.120:9001";
    static final String HADOOP_USER = "dkcrow";

    public static Configuration getConf(){
        Configuration conf = new Configuration();

        setRemoteInfo(conf);

        System.setProperty("HADOOP_USER_NAME", HADOOP_USER);
        return conf;
    }

    public static void setRemoteInfo(Configuration conf) {
        conf.set("fs.default.name", FS_DEFAULT_NAME);
        conf.set("mapred.job.tracker", MAPRED_JOB_TRACKER);
        conf.set("hadoop.job.ugi", HADOOP_USER);
    }
}
